package com.zzb.framework.modules.log.service;

import com.alibaba.fastjson.JSON;
import com.zzb.framework.common.BasePage;
import com.zzb.framework.common.BaseResponse;
import com.zzb.framework.common.BaseService;
import com.zzb.framework.modules.log.dao.SysLogDAO;
import com.zzb.framework.modules.log.entity.SysLogEntity;
import com.zzb.framework.modules.role.entity.SysUserEntity;
import com.zzb.framework.modules.role.vo.SystemUser;
import com.zzb.framework.validator.annotation.ValidatorEnabled;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
* 系统日志 service类
*/
@Service("sysLogService")
public class SysLogService extends BaseService<SysLogDAO, SysLogEntity> {
    private static final Logger logger = LoggerFactory.getLogger(SysLogService.class);
    @Autowired
    private SysLogDAO sysLogDAO;
    @Override
    public SysLogDAO getDAO() {
        return sysLogDAO;
    }


    /**保存系统日志*/
    @ValidatorEnabled
    public BaseResponse<SysLogEntity> saveSysLog(SysLogEntity sysLogEntity) {
        return insertOrUpdate(sysLogEntity, SystemUser.root());
    }

}
